package demo3;

import sun.awt.image.ImageWatched;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class TestDemo3 {
    public static void main(String[] args) {

        //接口的方式实现静态代理 (静态: 编译的过程中就已经知道给谁做代理)
        //Buyer buyer=new AgentBuyer(new RealBuyer());
       /* Buyer buyer=new AgentBuyer(new Zhangsan());
        String msg = buyer.havealook(); //步骤2 步骤3
        System.out.println(msg);

        int res =buyer.count();
        System.out.println(res);*/

        //类继承的方式实现静态代理
        RealBuyer buyer = new Lisi();
        String msg  =buyer.havealook();
        System.out.println(msg);

    }
}
